// import Vue from 'vue'
// import Router from 'vue-router'
import store from './store.js'
Vue.use(VueRouter)
import {
    getToken,
    getCookie,
    removeToken
} from '@/utils/cookie'

import {
    Message
} from 'element-ui'
let router = new VueRouter({
    mode: 'history',
    routes: [{
            path: "/",
            name: "entry",
            redirect: "index",
            component: () => import("./Entry.vue"),
            children: [{
                path: "/index",
                name: "index",
                component: () => import("./components/Index.vue"),
                // children: [{
                //     path: "/files",
                //     name: "files",
                //     component: () => import("../components/main/Files.vue")
                // }, {
                //     path: "/download",
                //     name: "download",
                //     component: () => import("../components/main/Download.vue")
                // }]
            }, {
                path: '/login',
                name: 'login',
                component: () => import("./components/Login.vue"),
            }, ]
        },
        {
            path: '*',
            name: '404',
            component: () => import("./components/404.vue"),
        }
    ]
})

router.beforeEach((to, from, next) => {
    NProgress.start()
    next();
})
router.afterEach((to, from) => {
    NProgress.done()
})

export default router;